package com.masterclient.app.businessmodule.settingmodule.api;

import com.eoner.baselib.container.CommonBaseResponse;
import com.eoner.common.bean.base.CommonBaseBean;
import com.eoner.managerlibrary.netsign.core.FCRetrofitManager;
import com.masterclient.app.businessmodule.minemodule.index.tutor.MyTutorBean;
import com.masterclient.app.businessmodule.settingmodule.auth.bean.CustomerOcrBean;
import com.masterclient.app.businessmodule.settingmodule.auth.bean.OcrBean;
import com.masterclient.app.businessmodule.settingmodule.bankcard.bean.NewBankBean;
import com.masterclient.app.businessmodule.settingmodule.bankcard.bean.NewBankCardBean;
import com.masterclient.app.businessmodule.settingmodule.bankcard.bean.OperateResultBean;
import com.masterclient.app.businessmodule.settingmodule.crossborder.model.CrossBorderListBean;
import com.masterclient.app.businessmodule.settingmodule.crossborder.model.DefaultCrossBorderBean;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;

public class SettingHttpService {

    private static SettingApi api;
    private static SettingHttpService instance;
    public static SettingHttpService getInstance() {
        synchronized (SettingHttpService.class){
            if(instance == null){
                instance = new SettingHttpService();
            }
        }
        return instance;
    }

    private SettingHttpService() {
        api = FCRetrofitManager.getInstance().getRetrofit().create(SettingApi.class);
    }

    /**
     * ocr
     * */
    public io.reactivex.Observable<CommonBaseResponse<OcrBean>> new_ocr(List<MultipartBody.Part> parts) {
        return api.new_ocr(parts);
    }

    /**
     * 上传身份证图片
     * */
    public io.reactivex.Observable<CommonBaseBean> ocr_info_send(RequestBody body) {
        return api.ocr_info_send(body);
    }

    /**
     * 获取银行卡
     * */
    public io.reactivex.Observable<CommonBaseResponse<NewBankCardBean>> getBankCard() {
        return api.getBankCard();
    }

    //获取清关实名列表
    public io.reactivex.Observable<CrossBorderListBean> customer_cross_border_list() {
        return api.customer_cross_border_list();
    }

    public io.reactivex.Observable<CommonBaseBean> customer_cross_border_del(RequestBody body) {
        return api.customer_cross_border_del(body);
    }

    public io.reactivex.Observable<DefaultCrossBorderBean> setCrossBorderDefault(RequestBody body) {
        return api.setCrossBorderDefault(body);
    }

    public io.reactivex.Observable<CommonBaseBean> cross_border_manage(RequestBody body) {
        return api.cross_border_manage(body);
    }

    public io.reactivex.Observable<CommonBaseResponse<CustomerOcrBean>> customs_ocr(List<MultipartBody.Part> parts) {
        return api.customs_ocr(parts);
    }

    /**
    * 退出登录
    * */
    public io.reactivex.Observable<CommonBaseBean> logout() {
        return api.logout();
    }

    /**
     * 银行卡列表
     * */
    public io.reactivex.Observable<CommonBaseResponse<NewBankBean>> getBank() {
        return api.getBank();
    }

    /**
     * 管理银行卡
     * */
    public io.reactivex.Observable<OperateResultBean> cardManage(RequestBody body) {
        return api.cardManage(body);
    }

    /**
     * 移除银行卡
     * */
    public io.reactivex.Observable<OperateResultBean> cardRemove(RequestBody body) {
        return api.cardRemove(body);
    }

    /**
     * 我的导师
     * */
    public io.reactivex.Observable<CommonBaseResponse<MyTutorBean>> getMyTutorInfo() {
        return api.getMyTutorInfo();
    }

}
